package com.hedy.user.controller;



import com.hedy.user.service.UserService;
import dto.UserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "user")
@RefreshScope
public class UserController {


//TODO: 此处加入properties属性报错
//    @Value("${token}")
    private String token;

    @Autowired
    UserService userService;

    @GetMapping(value = "getUser")
    public UserDTO getUserInfo(Integer uid){
        System.out.println("uid="+uid);
        return  userService.getUser(uid);

    }

    @GetMapping(value = "token")
    public String getToken (Integer uid){
        return "token";

    }

}
